#ifndef CM_NET_H_
#define CM_NET_H_

struct net_session {
    int fd;

};
typedef struct net_session net_session;

typedef struct net_server net_server;

net_server * nets_create(const char * node, const char * service);

typedef struct net_client net_client;

net_client * netc_create(const char * node, const char * service);

enum netm_type {
    NETM_TYPE_SELECT, // IO复用
    NETM_TYPE_THREAD, // 线程池
    NETM_TYPE_ASYNCIO // 异步IO
};

typedef struct net_manager net_manager;

#define NETM_FLAG_NONE  0

net_manager * netm_create(enum netm_type type, unsigned flag);

void netm_destroy(net_manager ** manager);

int netm_addserver(net_server * server);

int netm_addclient(net_client * client);

#endif /* CM_NET_H_ */
